<ui:composition template="/templates/layout.xhtml" xmlns="http://www.w3.org/1999/xhtml"
     xmlns:h="http://java.sun.com/jsf/html"
     xmlns:f="http://java.sun.com/jsf/core"
     xmlns:ui="http://java.sun.com/jsf/facelets"
     xmlns:c="http://java.sun.com/jstl/core"
     xmlns:fmt="http://java.sun.com/jstl/fmt"
     xmlns:x="http://java.sun.com/jstl/xml"
     xmlns:fn="http://java.sun.com/jstl/functions"
     xmlns:a4j="http://richfaces.org/a4j"
     xmlns:rich="http://richfaces.org/rich"
     xmlns:gape="http://componentes.gape/component/gape">
     
	<ui:define name="titulo">
		<h:outputText value="#{msg.applicationName} - #{msg.titleTelaSearchStrategicPlan}" />
	</ui:define>

	<ui:define name="menu">
	</ui:define>
	
	<ui:define name="conteudo">
		<h:panelGrid columns="1">
			<rich:dataTable id="strategicPlanTable" columnClasses="" headerClass="headTable" rowClasses="odd,even" 
							value="#{strategy.listStrategicPlan}" var="row" rows="10">
				<rich:column>
					<f:facet name="header">
						<h:outputText value="#{msg.nameTitleColumn}" />
					</f:facet>
					<h:outputText value="#{row.nome}" />
				</rich:column>
				
				<rich:column>
					<f:facet name="header">
						<h:outputText value="#{msg.initialDateTitleColumn}" />
					</f:facet>
					<h:outputText value="#{row.dataCriacaoString}" />
				</rich:column>
				
				<rich:column>
					<f:facet name="header">
						<h:outputText value="#{msg.finalDateTitleColumn}" />
					</f:facet>
					<h:outputText value="#{row.dataFimString}" />
				</rich:column>
				
				<rich:column>
					<f:facet name="header">
						<h:outputText value="#{msg.organizationTitleColumn}" />
					</f:facet>
					<h:outputText value="#{row.nomeOrganizacao}" />
				</rich:column>
				
				<rich:column>
					<h:commandLink action="#{strategy.openView}" value="#{msg.buttonView}" styleClass="buttonLink">
						<f:setPropertyActionListener value="#{row.nome}" target="#{strategy.nome}" />
						<f:setPropertyActionListener value="#{row.dataCriacao}" target="#{strategy.dataCriacao}" />
						<f:setPropertyActionListener value="#{row.dataFim}" target="#{strategy.dataFim}" />
						<f:setPropertyActionListener value="#{row.descricao}" target="#{strategy.descricao}" />
						<f:setPropertyActionListener value="#{row.organizacaoId}" target="#{strategy.selectedOrganization}" />
						<f:setPropertyActionListener value="#{row.nomeOrganizacao}" target="#{strategy.nomeOrganizacao}" />						
						<f:setPropertyActionListener value="#{row.strategicPlanId}" target="#{strategy.strategicPlanId}" />
						<f:setPropertyActionListener value="#{false}" target="#{strategy.menuSaveDisabled}" />
					</h:commandLink>
				</rich:column>
				
	 			<f:facet name="footer">
	                <rich:datascroller maxPages="20">
	                </rich:datascroller>
	            </f:facet>
			</rich:dataTable>
		</h:panelGrid>
	</ui:define>
	
	<ui:define name="menuTela">
		<ui:include src="menu.xhtml" />
	</ui:define>
	
	<ui:define name="menuNavegacaoBack">
		<gape:navigationBack />
	</ui:define>
	
	<ui:define name="menuNavegacaoForward">
		<gape:navigationForward disabled="#{true}"/>
	</ui:define>
</ui:composition>